<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                xmlns:component="http://java.sun.com/jsf/composite/component"
                template="/templates/template.xhtml">
    <ui:define name="title">商务催款跟进</ui:define>
    <ui:define name="content">
        <h:form>
            <div class="ui-g ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12 ">
                    <div class="ui-g-12 card">
                        <div class="ui-g-12">
                            <h1>收款信息</h1>
                        </div>
                        <div class="ui-g-12">
                            <div class="ui-g-2">
                                <p:outputLabel value="应收日期"/>
                            </div>
                            <div class="ui-g-4">

                                <p:calendar id="receiveDate" value="#{swMoneyFlowBean.$.moneyFlowDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="应收金额"/>
                            </div>
                            <div class="ui-g-4">
                                <div class="input-group">
                                    <p:inputText value="#{swMoneyFlowBean.$.moneyFlowNum}"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款账户"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.$.receiveAccountName}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款账号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.$.receiveAccount}"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="收款凭证"/>
                            </div>
                            <div class="ui-g-4">
                                <!--没有上传过文件显示-->
                                <p:outputPanel id="filepanel">
                                    <div style="display: flex;align-items: center;">

                                        <p:fileUpload fileUploadListener="#{swMoneyFlowBean.fileUpload}"
                                                      mode="advanced"
                                                      update="messages,filepanel,upImage" auto="true" process="@this"
                                                      allowTypes="/(\.|\/)(gif|jpe?g|png)$/" label="上传"
                                                      rendered="#{swMoneyFlowBean.$.pingzhengUrl==null}"/>

                                        <p:commandButton value="查看" style="margin-right: 2%"
                                                         process="@this"
                                                         onclick="PF('upImage').show()"
                                                         rendered="#{swMoneyFlowBean.$.pingzhengUrl!=null}"/>


                                        <p:fileUpload fileUploadListener="#{swMoneyFlowBean.fileUpload}"
                                                      mode="advanced"
                                                      update="messages,filepanel,upImage" auto="true" process="@this"
                                                      allowTypes="/(\.|\/)(gif|jpe?g|png)$/" label="重新上传"
                                                      rendered="#{swMoneyFlowBean.$.pingzhengUrl!=null}"/>

                                        <p:growl id="messages" showDetail="true"/>
                                    </div>
                                </p:outputPanel>
                            </div>
                        </div>

                        <div class="ui-g-12">
                            <h1>出票信息</h1>
                        </div>
                        <div class="ui-g-12">
                            <div class="ui-g-2">
                                <p:outputLabel value="快递单号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.cwOutTicketInfo.courierNumber}" readonly="true"/>
                            </div>
                            <div class="ui-g-6"/>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件人姓名"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.cwOutTicketInfo.sendManName}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="签收日期"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.cwOutTicketInfo.receiveDate}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件人手机号"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.cwOutTicketInfo.sendManMobile}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="寄件日期"/>
                            </div>
                            <div class="ui-g-4">
                                <p:inputText value="#{swMoneyFlowBean.cwOutTicketInfo.sendDate}" readonly="true"/>
                            </div>
                            <div class="ui-g-2">
                                <p:outputLabel value="开票凭证上传"/>
                            </div>
                            <div class="ui-g-4">

                                <p:commandButton value="查看"
                                                 process="@this"
                                                 onclick="PF('otImage').show()"
                                                 rendered="#{swMoneyFlowBean.cwOutTicketInfo.outTicketUrl!=null}"/>

                            </div>
                        </div>

                        <div class="ui-g-12"><h3><b>基本信息</b></h3></div>
                        <div class="ui-g-2">
                            <p:outputLabel value="甲方公司名称"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.companyName}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="合作模式"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:selectOneMenu id="copMode" value="#{swMoneyFlowBean.companyInfo.copMode}"
                                             disabled="true">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{swMoneyFlowBean.dictionaries[DictionaryCode.COOPERATION_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="产品名称"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:chips id="advantageTag" value="#{swMoneyFlowBean.productNames}"
                                     disabled="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="纳税识别号"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.taxIdentificationNumber}"
                                         readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="公司背景"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:selectOneMenu id="companyBackground"
                                             value="#{swMoneyFlowBean.companyInfo.companyBackground}"
                                             disabled="true">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{swMoneyFlowBean.dictionaries[DictionaryCode.COMPANY_BACKGROUND]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="公司固话"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.companyPhone}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="商务姓名"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.contactName}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="商务电话"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.contactPhone}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="负责人"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.principal}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="审核人员"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputText value="#{swMoneyFlowBean.companyInfo.auditor}" readonly="true"/>
                        </div>
                        <div class="ui-g-2">
                            <p:outputLabel value="是否一般纳税人"/>
                            <strong style="color: red">*</strong>
                        </div>
                        <div class="ui-g-4">
                            <p:inputSwitch id="ifGeneralTaxpayer" onLabel="是" offLabel="否"
                                           value="#{swMoneyFlowBean.companyInfo.ifGeneralTaxpayer}"
                                           disabled="true"/>
                        </div>

                        <component:workflow-basic workflowBean="#{swMoneyFlowBean}" />

                    </div>
                </div>
            </div>

            <p:dialog widgetVar="otImage" modal="true" resizable="false" showEffect="clip" hideEffect="clip">
                <h:graphicImage id="otImage" url="#{swMoneyFlowBean.cwOutTicketInfo.outTicketUrl}"/>
            </p:dialog>
            <p:dialog widgetVar="upImage" modal="true" resizable="false" showEffect="clip" hideEffect="clip">
                <h:graphicImage id="upImage" url="#{swMoneyFlowBean.$.pingzhengUrl}"/>
            </p:dialog>

        </h:form>
    </ui:define>
</ui:composition>